﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestDongHo.aspx.cs" Inherits="Web.TestDongHo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
       <link rel="stylesheet" href="/Styles/main.css" /> 
      <link rel="stylesheet" href="/Styles/StyleMaster.css" /> 
    <link rel="shortcut icon" href="/images/dealcom.gif" type="image/x-icon" /> 
<script type="text/javascript">
    var year = 2012; //năm
    var month = 2; //tháng 
    var day = 29; //ngày
    var h = 12; //giờ
    var i = 0; //phút
    var s = 0; //giây
    dateFuture1 = new Date(year, month, day, h, i, s);
    function GetCount(ddate, iid) {
    
        dateNow = new Date(); //grab current date
        amount = ddate.getTime() - dateNow.getTime(); //calc milliseconds between dates
        delete dateNow;

        // if time is already past
        if (amount < 0) {
            document.getElementById(iid).innerHTML = "Now!";
        }
        // else date is still good
        else {
            hours = 0; mins = 0; secs = 0; out = "";

            amount = Math.floor(amount / 1000); //kill the "milliseconds" so just secs

            hours = Math.floor(amount / 3600); //hours
            amount = amount % 3600;

            mins = Math.floor(amount / 60); //minutes
            amount = amount % 60;

            secs = Math.floor(amount); //seconds

            out += (hours <= 9 ? '0' : '') + hours + " " + ((hours == 1) ? "hour" : "") + ": ";
            out += (mins <= 9 ? '0' : '') + mins + " " + ((mins == 1) ? "min" : "") + ": ";
            out += (secs <= 9 ? '0' : '') + secs + " " + ((secs == 1) ? "sec" : "") + ": ";
            out = out.substr(0, out.length - 2);
            document.getElementById(iid).innerHTML = out;

            setTimeout(function () { GetCount(ddate, iid) }, 1000);
        }
    }
    window.onload = function () {
        GetCount(dateFuture1, 'countbox1');
        //you can add additional countdowns here (just make sure you create dateFuture2 and countbox2 etc for each)
    };
</script>
</head>
<body>
    <form id="form1" runat="server">
        <div  class="col-left">
            <div class="Tensp"><asp:Label runat="server" ID="lbProductName" EnableViewState="false" Text="Chăn Everon"  ToolTip='<%#Eval("ProductName") %>'></asp:Label></div>
            <div class="Giaosp">
            <img  src="/images/icont-voucher_03.png" alt=""/><a class="Giaohang"><i>(Giao Hàng)</i></a></div>
            <div class="Anhsp"><img class="Logochuaban" style="width:88px;height:89px" src="/images/chua-ban_11.png" alt=""/>
            <a href="/chi-tiet/<%# Eval("ProductName_Eng")%>.aspx"><asp:Image ID="Image1" runat="server" CssClass="imgSanPham" ImageUrl="/images/chaneveron.jpg"  ToolTip='<%#Eval("ProductName") %>' /></a></div>          
            <div class="Motassp"><asp:Label ID="lblMota"  runat="server" Text="">Hãy thưởng thức cốc sữa chua do bạn tự làm hoặc mời người thân - Chỉ với 400.000Đ</asp:Label></div>            
            <div class="Khunggia fl">
                <div class="fl">
                   <div class="GiaspMoi2">Giá:<strike>400.000 (VND)</strike></div>
                    <div class="GiaspGoc2"><asp:Label runat="server" ID="lbgiaban"></asp:Label></div>            
                    <div class="GiaspGoc2"><%# Eval("DealXu")%> 40 DealXu</div>
                    </div>
                </div>
                <div class="btnXem2 fr" style="padding-right:10px;"><a href="/chi-tiet/<%# Eval("ProductName_Eng")%>.aspx">         
                    <img title='<%#Eval("ProductName") %>' src="/images/xem-nho_03.gif" style="border:0px;padding-top:20px;padding-left:20px;" /> </a>                                  
                </div>
         
            <div class="cl"></div>
           
  
            <div class="NenXam">
                <div class="Khungthongbao">
                    <div class="Khungtt1 fl"> Tiết Kiệm </div>
                    <div class="Khungtt1 fl">Số người đã mua</div>
                    <div class="Khungtt1 ">Thời gian còn lại </div>
                </div>
                <div class="Khungthongbao2">
                    <div class="duoi1 fl"> 40% </div>
                    <div class="duoi1 fl">100</div>
                    <div id="countbox1" style=" font-size:12px; font-weight:bold"></div>  
                </div>
            </div>
            
     </div>
    </form>
</body>
</html>
